package com.example.myapplication.status2;


public class StatusDownloadFailed extends Status {
    public StatusDownloadFailed(StatusContext statusContext) {
        super(statusContext);
    }

//    @Override
//    public void updateView() {
//    }

    @Override
    public void doAction() {
        FileUtils.getSingleExcutor().execute(() -> {
            statusContext.setStatus(new StatusDownloading(statusContext));
            statusContext.changeEvent(null);
        });
    }

    @Override
    public void translateStatus() {
        System.out.println("status - 下载失败");
        statusContext.updateView(Event.DOWNLOAD_FAILED);
    }

    @Override
    public void eventChange(Event event) {
//        translateStatus();
        doAction();
    }
}
